let mongoose = require('mongoose'),
    config = require('./config');

module.exports = () => {
    mongoose.Promise = global.Promise;
    let db = mongoose.connect(config.mongodb, {useNewUrlParser: true});

    require('../models/member_users.js');
    require('../models/system_records.js');
    require('../models/resources_posts.js');
    require('../models/resources_thumbs.js');
    require('../models/message_reply.js');
    require('../models/appids.js');
    require('../models/categorys.js');

    return db;
}
